<!DOCTYPE html>
<html>
<head>
<title>Fig. 2.33 Reproduction</title>
</head>
<body>
<canvas id="canvas" width="550" height="370"></canvas>
<script>
    const canvas = document.getElementById('canvas');
    const ctx = canvas.getContext('2d');

    // Style settings
    ctx.lineWidth = 1.8;
    ctx.strokeStyle = 'black';
    ctx.fillStyle = 'black';
    ctx.font = "18px 'Times New Roman'";
    ctx.textAlign = "center";
    ctx.textBaseline = "middle";

    // Define coordinates
    const x0 = 70;
    const y0 = 280;
    const xAxisLength = 420;
    const yAxisHeight = 230;
    const framePadding = 25;

    // Draw frame
    ctx.strokeRect(x0 - framePadding, y0 - yAxisHeight - framePadding, xAxisLength + 2*framePadding + 10, yAxisHeight + 2*framePadding + 10);

    // Draw axes
    ctx.beginPath();
    // Y-axis
    ctx.moveTo(x0, y0);
    ctx.lineTo(x0, y0 - yAxisHeight);
    // X-axis
    ctx.moveTo(x0, y0);
    ctx.lineTo(x0 + xAxisLength, y0);
    ctx.stroke();

    // Draw axis labels
    // Y-axis label (σ)
    ctx.fillText("\u03C3", x0, y0 - yAxisHeight - 10);
    
    // X-axis label (Eγ(MeV))
    // The gamma (γ) symbol is placed as a subscript by drawing it separately with a smaller font and adjusted position.
    const xLabelStart = x0 + xAxisLength - 20;
    const yLabel = y0 + 20;
    ctx.font = "18px 'Times New Roman'";
    ctx.textAlign = "left";
    ctx.fillText("E", xLabelStart, yLabel);
    const eWidth = ctx.measureText("E").width;
    ctx.font = "14px 'Times New Roman'";
    ctx.fillText("\u03B3", xLabelStart + eWidth - 2, yLabel + 4);
    const gWidth = ctx.measureText("\u03B3").width;
    ctx.font = "18px 'Times New Roman'";
    ctx.fillText("(MeV)", xLabelStart + eWidth + gWidth - 2, yLabel);
    
    // Reset alignment for other text
    ctx.textAlign = "center";


    // Draw peaks and their labels
    const yLabelNum = y0 + 18;

    // Peak at 1.2 MeV
    const x1 = 150;
    const h1 = 70;
    const w1 = 30;
    ctx.beginPath();
    ctx.moveTo(x1 - w1 / 2, y0);
    ctx.quadraticCurveTo(x1, y0 - h1 * 1.5, x1 + w1 / 2, y0);
    ctx.stroke();
    ctx.fillText("1.2", x1, yLabelNum);

    // Peak at 2.6 MeV
    const x2 = 230;
    const h2 = 140;
    const w2 = 30;
    ctx.beginPath();
    ctx.moveTo(x2 - w2 / 2, y0);
    ctx.quadraticCurveTo(x2, y0 - h2 * 1.5, x2 + w2 / 2, y0);
    ctx.stroke();
    ctx.fillText("2.6", x2, yLabelNum);

    // Peak at 14 MeV
    const x3 = 420;
    const h3 = 90;
    const w3 = 80;
    ctx.beginPath();
    ctx.moveTo(x3 - w3 / 2, y0);
    ctx.quadraticCurveTo(x3, y0 - h3 * 1.2, x3 + w3 / 2, y0); // A bit more rounded than the sharp peaks
    ctx.stroke();
    ctx.fillText("14", x3, yLabelNum);
    
    // Draw caption
    ctx.font = "18px 'Times New Roman'";
    ctx.fillText("Fig. 2.33", 275, 340);

</script>
</body>
</html>